<!doctype html>
<html>
	<head>
		<title>羽乐汇</title>
		<meta name="keywords" content="羽毛球，球会，球场，教练">
		<meta name="charset" content="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/bootstrap.min.css">
		<!-- <link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/wap_index.css"> -->
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/index.css">
		
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/jquery.min.js"></script>
		
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/bootstrap.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/md5.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/query-object.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/yuleclub.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/index.js"></script>
    </head>
	<body>
	<!-- ---------------------------------------------------------------pc_index--------------------------------------------------------- -->
		<div class="visible-lg visible-md pc_index">
			<div class="top">
				<div class="ttop">
					<span>欢迎来到羽乐汇</span>
					<div>
						<span class="wellcome"></span>
						<span class="login">
							<a href="<{:U('Login/userlogin')}>">登陆</a>
							<!-- <button class="notlogin_btn">注销</button> -->
							<a href="<{:U('Index/registration')}>">注册</a>
							
						</span>
						<!-- <button class="sign_btn">注册</button> -->
						<a class="login_after" href="<{:U('User/index')}>">个人主页</a>
						<a href="<{:U('Competition/create_competition')}>">vip中心</a>
					</div>
				</div>
				<div>
					<img src="__PUBLIC__/PICTURE/HomePage/logo.jpg">
				</div>
				<div class="main_nav">
					<ul>
						<li><a href="<{:U('Index/index')}>">首页</a></li>
						<li><a href="<{:U('Gymnasium/index')}>">球场</a></li>
						<li><a href="<{:U('Club/index')}>">球会</a></li>
						<li>培训</li>
						<li><a href="<{:U('Activity/activity',array('activity_type'=>0))}>">活动</a></li>
						<li><a href="<{:U('Coach/index')}>">教练</a></li>
						<li><a href="<{:U('Competition/index')}>">竞赛</a></li>
						<li><a href="<{:U('Announce/index')}>">公告</a></li>
					</ul>
				</div>
			</div>

			<div class="middle">middle</div>
			<div class="foot">
				<div>
					<p>联系我们</p>
					<p>关于我们</p>
					<p>加入我们</p>
				</div>
				<div>
					<p>电话：400-800-8888 周一至周六9：00-18：00</p>
					<p>[羽乐汇]<a href="http://oto.my3w.com">http://oto.my3w.com</a></p>
				</div>
				<div class="to_top">
					<a href="#"></a>
				</div>
			</div>
		</div>
		<!-- ---------------------------------wap_index---------------------------------- -->
		<div class="visible-xs visible-sm wap_index">
			<div class="container-fluid" id="wap_index">
				<header class="row">
					<div class="col-xs-2 col-sm-2"></div>
					<p class="col-xs-4 col-sm-4">欢迎<span class="userid"></span></p>
					<div class="col-xs-6 col-sm-6">
					<span class="login">
						<a class="visible-lg visible-md" href="<{:U('Bizhomepage/index')}>">后台管理</a>
						<a href="<{:U('Index/registration')}>"/>注册 </a> 
						<a href="<{:U('Login/userLogin')}>">登陆</a>
					</span>
					</div>
				</header>
				<div class="row img-responsive" id="log_img">
					<img class="img-responsive" src="__PUBLIC__/PICTURE/HomePage/logo.jpg"/>
				</div>
				<div class="row" id="nav_button">
					<table class="table table-bordered">
						<tbody>
							<tr>
								<td><a href="<{:U('Club/index')}>">球会</a></td>
								<td><a href="<{:U('Gymnasium/index')}>">球场</a></td>
								<td><a href="<{:U('Coach/index')}>">教练</a></td>
							</tr>
							<tr>
								<td><a href="<{:U('Activity/activity')}>">活动</a></td>
								<td><a href="<{:U('Competition/index')}>">竞赛</a></td>
								<td><a href="<{:U('Announce/index')}>">公告</a></td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="row" id="content">
					<img src="__PUBLIC__/PICTURE/HomePage/content.jpg">
				</div>
				<div class="row" id="foot">
					<div>
						<p>联系我们</p>
						<p>关于我们</p>
						<p>加入我们</p>
					</div>
					<div>
						<p>电话：400-800-8888 周一至周六9：00-18：00</p>
						<p>[羽乐汇]<a href="http://oto.my3w.com">http://oto.my3w.com</a></p>
					</div>
				</div>
			</div>	
		</div>
		<!-- --------------------------loginbox------------------------------------------ -->
	</body>
	<script>
		<!-- --------------------------获取登录返回的状态和用户名信息，并删除多余url参数和添加cookie------------------------------------------ -->
		// var username= "<{$userName}>";
		// var username=GetQueryString("user_name");
		// alert(username);
		var userurl="<{:U('User/index')}>";
		var login_failed = "<{$if_login_failed}>";
		if(login_failed === "0")
		{
			setCookie("username",username);
		}
		<!-- ----------------修改标题后的username，替换注销---------------------- -->
		//获取cookie字符串 
		var strCookie=document.cookie; 
		//将多cookie切割为多个名/值对 
		var arrCookie=strCookie.split("; "); 
		//遍历cookie数组，处理每个cookie对 
		for(var i=0;i<arrCookie.length;i++){ 
			var arr=arrCookie[i].split("="); 
		//找到名称为username的cookie，并返回它的值 
			if("username"==arr[0]){ 
				username=arr[1]; 
				break; 
				} 
		} 
		if(username.length!=0)
		{
			var ka = document.getElementsByClassName("login");
			if(ka.length > 1){
        	    for(i=0; i<ka.length; i++){
        	        ka[i].innerHTML = '<a class="logout_btn" onclick="logout()">注销</a><a class="login_after" href="<{:U('User/index')}>">个人主页</a>';
        	    }
        	}else{
            		ka[0].innerHTML = '<a class="logout_btn" onclick="logout()">注销</a><a class="login_after" href="<{:U('User/index')}>">个人主页</a>';
        	}
        	var va = document.getElementsByClassName("userid");
        	if(va.length > 1){
        	    for(i=0; i<va.length; i++){
        	        va[i].innerHTML = "<a href="+userurl+">"+username+"</a>";
        	    }
        	}else{
            	va[0].innerHTML = "<a href="+userurl+">"+username+"</a>";;
        	}
        }
        <!-- ----------------注销---------------------- -->


    <!----------调用百度API返回位置信息------------>
		// function getLocation(){
		// 	if (navigator.geolocation){
		// 		navigator.geolocation.getCurrentPosition(showPosition,showError);
		// 	}else{
		// alert("浏览器不支持地理定位。");
		// 	}
		// }
		// function showPosition(position){ 
  //   	var latlon = position.coords.latitude+','+position.coords.longitude; 
     
  //   	//baidu 
  //   		var url = "http://api.map.baidu.com/geocoder/v2/?ak=C93b5178d7a8ebdb830b9b557abce78b&callback=renderReverse&location="+latlon+"&output=json&pois=0"; 
  //  		 $.ajax({  
  //      		 type: "GET",  
  //      		 dataType: "jsonp",  
  //      		 url: url, 
  //     		  beforeSend: function(){ 
  //        		   // $("#baidu_geo").html('正在定位...'); 
  //      		 }, 
  //       		success: function (json) {  
  //         		  if(json.status==0){ 
  //         		      // $("#baidu_geo").html(json.result.addressComponent.city); 
  //         		      province=json.result.addressComponent.province;
  //         		      city=json.result.addressComponent.city;
  //         		      district=json.result.addressComponent.district;
  //         		      setCookie("provice",province);
  //         		      setCookie("city",city);
  //         		      setCookie("district",district);
  //         		      setCookie("mzz","success");
  //         		  }
  //     		  }, 
  //      		 error: function (XMLHttpRequest, textStatus, errorThrown) {  
  //      		     // $("#baidu_geo").html(latlon+"地址位置获取失败");  
  //      		 } 
  //  		 }); 
		// } 
		// function showError(error){
		// 	switch(error.code) {
		// 		case error.PERMISSION_DENIED:
		// 			alert("定位失败,用户拒绝请求地理定位");
		// 			break;
		// 		case error.POSITION_UNAVAILABLE:
		// 			alert("定位失败,位置信息是不可用");
		// 			break;
		// 		case error.TIMEOUT:
		// 			alert("定位失败,请求获取用户位置超时");
		// 			break;
		// 		case error.UNKNOWN_ERROR:
		// 			alert("定位失败,定位系统失效");
		// 			break;
 	// 	   }
		// }
		// $(function(){
		// 	getLocation();
		// });
	</script>
</html>
